]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Bug 587955 - Small cleanups to iconButton
authorMilan Bouchet-Valat <nalimilan@club.fr>
Sat, 11 Jul 2009 16:44:21 +0000 (18:44 +0200)
committerMilan Bouchet-Valat <nalimilan@club.fr>
Sat, 11 Jul 2009 16:44:21 +0000 (18:44 +0200)
Missing trailing ; after "this._fadeOut()". A few missing spaces after "if". Parameter inconsistently named "icon" instead of "texture".

js/ui/button.js

index 1247aee0af9fa9f796dd2cfaaebd4cb2bedd7455..4ce88ad55176fcfbdd715197a95cb480b2acc6fb 100644 (file)
@@ -128,14 +128,14 @@ const ANIMATION_TIME = 0.25;
  * size -- size in pixels of  both the button and the icon it contains
  * texture -- optional, must be used if the texture for the icon is already created (else, use setIconFromName)
  */
-function iconButton(parent, size, icon) {
-    this._init(parent, size, icon);
+function iconButton(parent, size, texture) {
+    this._init(parent, size, texture);
 }
 
 iconButton.prototype = {
     _init : function(parent, size, texture) {
         this._size = size;
-        if(texture)
+        if (texture)
             this.actor = texture;
         else
             this.actor = new Clutter.Texture({ width: this._size, height: this._size });
@@ -145,23 +145,23 @@ iconButton.prototype = {
             this._shouldHide = false;
 
             // Nothing to do if the cursor has come back from a child of the parent actor
-            if(actor.get_children().indexOf(Shell.get_event_related(event)) != -1)
+            if (actor.get_children().indexOf(Shell.get_event_related(event)) != -1)
                 return;
 
             this._fadeIn();
         }));
         parent.connect("leave-event", Lang.bind(this, function(actor, event) {
             // Nothing to do if the cursor has merely entered a child of the parent actor
-            if(actor.get_children().indexOf(Shell.get_event_related(event)) != -1)
+            if (actor.get_children().indexOf(Shell.get_event_related(event)) != -1)
                 return;
 
             // Remember that we should not be visible to hide the button if forceShow is unset
-            if(this._forceShow) {
+            if (this._forceShow) {
                 this._shouldHide = true;
                 return;
             }
 
-            this._fadeOut()
+            this._fadeOut();
         }));
     },
 
@@ -187,7 +187,7 @@ iconButton.prototype = {
     forceShow : function(show) {
         this._forceShow = show;
         // Hide the button if it should have been hidden under normal conditions
-        if(!this._forceShow && this._shouldHide) {
+        if (!this._forceShow && this._shouldHide) {
            this._fadeOut();
         }
     },